package ace.cmp.data.methodname.method.name.sql.test.core.util;

import ace.cmp.data.methodname.method.name.sql.entity.model.EntityMapping;
import ace.cmp.data.methodname.method.name.sql.entity.model.EntityPropertyMapping;
import ace.cmp.data.methodname.method.name.sql.test.core.dao.entity.CasUser;
import java.time.LocalDateTime;
import java.util.Arrays;

/**
 * @author caspar
 * @date 2023/2/23 13:48
 */
public final class EntityMappingUtils {

  public static EntityMapping build() {
    return EntityMapping.builder()
        .entityClass(CasUser.class)
        .tableName("cas_user")
        .properties(
            Arrays.asList(
                EntityPropertyMapping.builder()
                    .propertyPathMeta("Id")
                    .column("id")
                    .property("id")
                    .propertyClass(String.class)
                    .propertyIsId(true)
                    .build(),
                EntityPropertyMapping.builder()
                    .propertyPathMeta("name")
                    .column("name")
                    .property("name")
                    .propertyClass(String.class)
                    .propertyIsId(false)
                    .build(),
                EntityPropertyMapping.builder()
                    .propertyPathMeta("mobile")
                    .column("mobile")
                    .property("mobile")
                    .propertyClass(String.class)
                    .propertyIsId(false)
                    .build(),
                EntityPropertyMapping.builder()
                    .propertyPathMeta("rowVersion")
                    .column("row_version")
                    .property("rowVersion")
                    .propertyClass(Integer.class)
                    .propertyIsId(false)
                    .build(),
                EntityPropertyMapping.builder()
                    .propertyPathMeta("updateTime")
                    .column("update_time")
                    .property("updateTime")
                    .propertyClass(LocalDateTime.class)
                    .propertyIsId(false)
                    .build(),
                EntityPropertyMapping.builder()
                    .propertyPathMeta("createTime")
                    .column("create_time")
                    .property("createTime")
                    .propertyClass(LocalDateTime.class)
                    .propertyIsId(false)
                    .build()))
        .build();
  }
}
